an open source package management system and environment management system
# installs to ~/usr/local/anaconda3/ by default
brew cask install anacondaadd the following to your .zshrc / .bash_profile
export PATH=/usr/local/anaconda3/bin:"$PATH"
initialize your .zshrc / .bash_profile
conda init zsh
conda init bashconda --version
which conda # doesn't work...
conda info
# get help
conda --help
conda install --helpwarning: this will delete all your conda environments!
brew cask upgrade anaconda# remove the configs
conda install anaconda-clean
anaconda-clean --yes
# creates a backup folder which you can also remove if you want to
rm -rf ~/.anaconda_backup
# uninstall anaconda
brew cask uninstall anacondaIf you installed via a method other than brew cask you may need to manually remove the anaconda install folder and
rm -rf ~/anaconda3You will also need to remove the >>> conda init >>> section in ~/.bash_profile and ~/.zshrc.
# main directory for current env
echo $CONDA_PREFIX
# list all environments
conda env list
conda info --envs
# create new environments (see also note below)
conda create -y --name py2 python=2.7.12
conda create -y --name py3 python=3.7.4
# clone an existing environment
conda create -y --clone py35 --name py35v2
# activate an environment
conda activate py3
# update python version for the current environment
conda update python
# deactivate an environment
conda deactivate
# delete an environment
conda env remove --name py2If you want to use a specific environment by default you can add something like this to your .zshrc/.bash_profile
echo 'conda activate py3' >> ~/.zshrc
echo 'conda activate py3' >> ~/.bash_profile# list all package versions installed in active environment
conda list
# install a package or packages to the active environment
conda install numpy
# install a package version to the active environment
conda install numpy==1.11
# update a package in the active environment
conda update numpy
# update all packages in the active environment
conda update --all
# install a package or packages to a named environment
conda install --name py3 \
#airflow \
#binarytree \
#boto3 \
#graphviz \
#ipykernel \
keras \
matplotlib \
numpy \
pandas \
#parquet-cpp \
#pyarrow \
pyhocon \
pymysql \
#python-graphviz \
seaborn \
#selenium \
scikit-learn \
scipy \
#snowflake-connector-python \
statsmodels \
xmltodict
# update all packages in a named environment
conda update --all --name py3# allow installation of conda-forge packages
conda config --add channels conda-forgeexamples
conda install --name py3 -c conda-forge airflow
conda install --name py3 -c conda-forge binarytree
conda install --name py3 -c conda-forge jira
conda install --name py3 -c conda-forge pyspark
#conda install --name py3 -c conda-forge snowflake-connector-python
conda install --name py3 -c conda-forge xgboostconda install --name py3 -c conda-forge --file requirements.txt# latest available python version
conda search python
conda search python | grep 'pkgs/main' | tail -1
conda search python | grep 'pkgs/main' | tail -1 | grep -Eo '(\d+\.\d+\.\d+){1}'
# latest available python package versions
conda search pandas | grep 'pkgs/main' | tail -1 | grep -Eo '(\d+\.\d+\.\d+){1}'
conda search scikit-learn | grep 'pkgs/main' | tail -1 | grep -Eo '(\d+\.\d+\.\d+){1}'Note: if you get a CondaHTTPError: HTTP 000 CONNECTION FAILED error, try running this:
conda config --set ssl_verify no